import request from "@/utils/request";

// 查询type列表
export function listType(query) {
  return request({
    url: "/system/type/list",
    method: "get",
    params: query,
  });
}

// 新增type
export function addType(data) {
  return request({
    url: "/system/type",
    method: "post",
    data: data,
  });
}

// 查询type详细
export function getType(id) {
  return request({
    url: "/system/type/" + id,
    method: "get",
  });
}

// 修改type
export function updateType(data) {
  return request({
    url: "/system/type",
    method: "put",
    data: data,
  });
}

// 删除type
export function delType(id) {
  return request({
    url: "/system/type/" + id,
    method: "delete",
  });
}

// 根据code查子类
export function childrenByCode(params) {
  return request({
    url: "/system/type/childrenByCode",
    method: "get",
    params,
  });
}
